CREATE TABLE jms_dm.dm_contract_area_bill_cnt_dt (
                                                     network_code varchar(50) NULL COMMENT "网点code",
                                                     belong_type varchar(50) NULL COMMENT "所属类别1 直营公司2 第三方3 底价业务员",
                                                     staff_code varchar(50) NULL COMMENT "业务员code",
                                                     date_time date NULL COMMENT "查询日期",
                                                     staff_name varchar(120) NULL COMMENT "业务员name",
                                                     network_name varchar(120) NULL COMMENT "网点name",
                                                     up2_bill_count int(11) NULL COMMENT "t-2日发货件量",
                                                     up1_bill_count int(11) NULL COMMENT "t-1发货件量",
                                                     total_bill_count int(11) NULL COMMENT "当日件量",
                                                     total_bill_mm int(11) NULL COMMENT "当月件量",
                                                     total_days_mm int(11) NULL COMMENT "当月发货天数",
                                                     source1_bill_cnt int(11) NULL COMMENT "桃花岛件量",
                                                     source2_bill_cnt int(11) NULL COMMENT "紫金山件量",
                                                     source3_bill_cnt int(11) NULL COMMENT "逍遥峰件量",
                                                     source4_bill_cnt int(11) NULL COMMENT "七星潭件量",
                                                     source5_bill_cnt int(11) NULL COMMENT "极地湾件量",
                                                     source6_bill_cnt int(11) NULL COMMENT "其他件量",
                                                     a_bill_cnt int(11) NULL COMMENT "a等级客户件量",
                                                     b2_bill_cnt int(11) NULL COMMENT "b+等级客户件量",
                                                     b_bill_cnt int(11) NULL COMMENT "b等级客户件量",
                                                     c_bill_cnt int(11) NULL COMMENT "c等级客户件量",
                                                     d_bill_cnt int(11) NULL COMMENT "d等级客户件量",
                                                     e_bill_cnt int(11) NULL COMMENT "e等级客户件量",
                                                     f_bill_cnt int(11) NULL COMMENT "f等级客户件量",
                                                     cnt_type int(11) NULL COMMENT "汇总类型（1业务员2所属类型3所属类型+网点）",
                                                     agent_code varchar(50) NULL COMMENT "网点所属代理区code",
                                                     agent_name varchar(120) NULL COMMENT "网点所属代理区name",
                                                     fran_code varchar(50) NULL COMMENT "网点所属加盟商code",
                                                     fran_name varchar(120) NULL COMMENT ""
) ENGINE=OLAP 
DUPLICATE KEY(network_code, belong_type, staff_code)
COMMENT "承包区各维度件量统计"
PARTITION BY RANGE(date_time)
(START ("2023-07-01") END ("2023-07-30") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(cnt_type) BUCKETS 4 
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-210",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);

alter table jms_dm.dm_contract_area_bill_cnt_dt add column
    (total_weight_count decimal(22,2) comment'当日总重量',
 total_weight_mm decimal(22,2) comment'当月总重量'
)